import request from '@/utils/request'

// 获取获取用户列表
export function employeesList(params) {
  return request({
    url: '/users',
    method: 'get',
    params
  })
}

// 获取获取用户数量
export function employeeCount() {
  return request({
    url: '/users/count',
    method: 'get'
  })
}

// 删除员工
export function deleteEmployee(id) {
  return request({
    url: '/users' + id,
    method: 'DELETE'
  })
}

// 添加员工
export function addEmployee(data) {
  return request({
    url: '/auth/local/register',
    method: 'POST',
    data
  })
}

// 获取指定用户信息
export function employeeDatail(id) {
  return request({
    url: '/users/' + id,
    method: 'GET'
  })
}

// 编辑用户信息
export function editEmployee(data) {
  return request({
    url: '/users/' + data.id,
    method: 'PUT',
    data
  })
}
